package principle.singleresponsibility;

/**
 * 单一职责原则演示 为遵循单一职责原则
 * 
 * @author Fengdong.Duan
 * @create 2023/11/7 9:51
 */
public class SingleResponsibility1 {
	public static void main(String[] args) {
		Vehicle vehicle = new Vehicle();
		vehicle.run("自行车");
		vehicle.run("轮船");
		vehicle.run("飞机");
	}
}

// 未遵守单一职责原则的结果
class Vehicle {

	public void run(String vehicle) {
		System.out.println(vehicle + "在公路上运行");
	}
}
